package com.slorgs.infrastructure.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@TableName("ams_api")
public class Api {
    @TableId("idApi")
    private String idApi;
    @TableField("apiName")
    private String apiName;
    @TableField("path")
    private String path;
    @TableField("model")
    private String model;
    @TableField("limiting")
    private int limiting;
    @TableField("createBy")
    private String createBy;
    @TableField("createTime")
    private Date createTime;
    @TableField("updateBy")
    private String updateBy;
    @TableField("updateTime")
    private Date updateTime;

    public String getIdApi() {
        return idApi;
    }

    public void setIdApi(String idApi) {
        this.idApi = idApi;
    }

    public String getApiName() {
        return apiName;
    }

    public void setApiName(String apiName) {
        this.apiName = apiName;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public int getLimiting() {
        return limiting;
    }

    public void setLimiting(int limiting) {
        this.limiting = limiting;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public static ApiBuilder builder() {
        return new ApiBuilder();
    }

    public Api() {
    }

    public Api(String idApi, String apiName, String path, String model, int limiting, String createBy, Date createTime, String updateBy, Date updateTime) {
        this.idApi = idApi;
        this.apiName = apiName;
        this.path = path;
        this.model = model;
        this.limiting = limiting;
        this.createBy = createBy;
        this.createTime = createTime;
        this.updateBy = updateBy;
        this.updateTime = updateTime;
    }

    public static class ApiBuilder {
        private String idApi;
        private String apiName;
        private String path;
        private String model;
        private int limiting;
        private String createBy;
        private Date createTime;
        private String updateBy;
        private Date updateTime;

        public ApiBuilder() {
        }

        public Api build() {
            return new Api(this.idApi, this.apiName, this.path, this.model, this.limiting, this.createBy, this.createTime, this.updateBy, updateTime);
        }

        public ApiBuilder idApi(String idApi) {
            this.idApi = idApi;
            return this;
        }

        public ApiBuilder apiName(String apiName) {
            this.apiName = apiName;
            return this;
        }


        public ApiBuilder path(String path) {
            this.path = path;
            return this;
        }

        public ApiBuilder model(String model) {
            this.model = model;
            return this;
        }
        public ApiBuilder limiting(int limiting) {
            this.limiting = limiting;
            return this;
        }
        public ApiBuilder createBy(String createBy) {
            this.createBy = createBy;
            return this;
        }
        public ApiBuilder createTime(Date createTime) {
            this.createTime = createTime;
            return this;
        }

        public ApiBuilder updateBy(String updateBy) {
            this.updateBy = updateBy;
            return this;
        }
        public ApiBuilder updateTime(Date updateTime) {
            this.updateTime = updateTime;
            return this;
        }
    }
}
